<?php

class m131116_071903_oak extends CDbMigration
{
    public function safeUp()
    {
        $sql = 'CREATE TABLE `{{search_purpose}}`
                (
                    `id` tinyint PRIMARY KEY,
                    `name` varchar(255),
                    `created_at` datetime,
                    `updated_at` datetime
                )
                ENGINE=InnoDB DEFAULT CHARSET=utf8;

                INSERT INTO `{{search_purpose}}` VALUES(0, "Make new friends", NOW(), NOW());
                INSERT INTO `{{search_purpose}}` VALUES(1, "Chat", NOW(), NOW());
                INSERT INTO `{{search_purpose}}` VALUES(2, "Date", NOW(), NOW());';

        $this->execute($sql);
    }

    public function safeDown()
    {
        return false;
    }
}